/**
 * 新鲜资讯标题输入框获取焦点，设置输入框校验显示信息列的样式
 */
function titleFocus(td_id_Col, s_id_Desc) {
    var infoMsg = "新鲜资讯标题，必填，最长64个字符";
    focusChk(td_id_Col, s_id_Desc, infoMsg);
}

/**
 * 新鲜资讯标题输入框失去焦点时的校验
 */
function titleBlur(i_obj, td_id_Col, s_id_Desc) {
	var objValue = i_obj.value;
    if(objValue) {
    	objValue = objValue.trim();
    	i_obj.value = objValue;
    }
    
	var errMsg = "";
    if(objValue == "") {
        errMsg = "新鲜资讯标题不能为空";
    } else if(objValue.length > 64 ) {
        errMsg = "新鲜资讯标题最大长度为64个字符";
    }
    
    return blurChk(td_id_Col, s_id_Desc, errMsg);
}

/**
 * 资讯正文输入框获取焦点，设置输入框校验显示信息列的样式
 */
function detailContentFocus(td_id_Col, s_id_Desc) {
    var infoMsg = "资讯正文，必填，最长1000个字符";
    focusChk(td_id_Col, s_id_Desc, infoMsg);
}

/**
 * 资讯正文输入框失去焦点时的校验
 */
function detailContentBlur(i_obj, td_id_Col, s_id_Desc) {
	var objValue = i_obj.value;
    if(objValue) {
    	objValue = objValue.trim();
    	i_obj.value = objValue;
    }
    
	var errMsg = "";
    if(objValue == "") {
        errMsg = "资讯正文不能为空";
    } else if(objValue.length > 1000 ) {
        errMsg = "资讯正文最大长度为1000个字符";
    }
    
    return blurChk(td_id_Col, s_id_Desc, errMsg);
}

/**
 * 表单提交
 */
function addNewInfoFun() {
	// 校验标题
	var titleObj = document.getElementById("title");
	if(!titleBlur(titleObj, 'titleCol', 'titleDesc')) {
		return false;
	}
	
	// 校验 资讯正文
	//var detailContentObj = document.getElementById("detailContent");
	//if(!detailContentBlur(detailContentObj, 'detailContentCol', 'detailContentDesc')) {
	//	return false;
	//}
	
	document.getElementById("newInfoForm").submit();
    return true;
}